/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

/**
 *
 * @author wpc
 */
public class Packet {

    private int pathId;
    private int index;
    private double arrival;
    private double finish;
    private double length;

    public Packet(int pathId, double arrival, double length) {
        this.pathId = pathId;
        this.index = 0;
        this.arrival = arrival;
        this.finish = this.arrival;
        this.length = length;
    }

    public double getFinish() {
        return finish;
    }

    public double getArrival() {
        return arrival;
    }

    public int getIndex() {
        return index;
    }

    public int getPathId() {
        return pathId;
    }

    public void update(double time){
        this.finish = time;
    }

    public double getLength() {
        return length;
    }

    public void toNext(){
        this.index++;
    }

    public double getDelay(){
        return this.finish - this.arrival;
    }
    
}
